<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
        <title>用户关注信息-品购网</title>
        <link href="__PUBLIC__/css/hangye.css" rel="stylesheet" type="text/css" />
		<link href="__PUBLIC__/css/comm.css" rel="stylesheet" type="text/css" />
		<link href="__PUBLIC__/css/panel.css" rel="stylesheet" type="text/css" />
		<link href="__PUBLIC__/css/person.css" rel="stylesheet" type="text/css" />		
        <script type="text/javascript" src="__PUBLIC__/js/jquery.js"></script>
        <script type="text/javascript" src="__PUBLIC__/js/tree.js"></script>
        <script type="text/javascript" src="__PUBLIC__/js/personflow.js"></script>
    </head>
    <body>
		<div class="containner">
        <include file="Index:header"/>
        <!--导航结束--> 
        <div id="myshare" style="position:absolute;top:0px;margin:auto;z-index:299"></div>
        <div class="body-center">
<!--            <div class="path">
				首页 >> 个人信息 >> 我的关注
            </div>-->
            <div class="w_tithead"> <strong>您当前的位置是： </strong><a href="__APP__">品购网首页</a><a  href="#">个人信息</a>我的关注</div>
            <div class="person_title">个人页面</div>
            <div class="contents">
                <div class="menu">
                    <include file="user_menu"/>
                </div>
                <div class="sharelist">
                    <span class="blue">以下是<span id="showtitle">为所有你关注和关注您</span>的用户发表的分享（可从右侧选择某个用户） </span><a id="showall" href="__APP__/Home/User/myFlow" class="btn">查看全部</a>
                    <div id="sharemessageList" class="sharemessage">
                        <ul>
                            <volist name="list" id="share">
                                <li>
                                    <div class="headimg">
                                        <img src="{$share.User.user_photo|default='__ROOT__/Public/images/user_photo.jpg'}" width="50" height="50">
                                    </div>
                                    <div class="message">
                                        <div class="title">
                                            <a class="name">{$share.User.user_name}：</a><a class="blue subject">{$share.caption|html_entity_decode=###}</a>
                                        </div>
                                        <div class="xinxi">
                                            <span>浏览：<a class="yellow">{$share.count_view}</a>次</span>
                                            <span>评分：<a class="yellow">{$share.score}</a></span>
                                            <!--<span>分享：<a class="yellow">98</a>次</span>-->
                                            <span class="time">{$share.time_add|date="Y-m-d",###}</span>
                                        </div>
                                        <div class="content">
										{$share.content|html_entity_decode=###}
                                            <span class="blue" viewall="viewall" style="cursor:pointer;"><a href="__APP__/Home/Share/Show?id={$share.id}">(查看全文...)</a></span>
                                        </div>
                                        <!--<div class="btns">
                                            <a href="#" hidefocus class="bluebtn caina">采纳</a>
                                            <a href="#" hidefocus class="bluebtn hulue">忽略</a>
                                        </div>-->
                                    </div>
                                </li>
                            </volist>
                        </ul>
                        <div id="flowPage" class="paging">
				{$page}
                        </div>
                    </div>
                </div>
                <div class="flowlist" id="flowList">
                    <div class="tab">
                        <ul  id="tab">
                            <li class="on" tabcontent="Iflow">我关注的</li>
                            <li tabcontent="flowI">关注我的</li>
                        </ul>
                    </div>
                    <div id="Iflow" class="flowhead" style="display:block;">
                        <volist name ="user_flow_info" id="user">
                            <div class="headimg">
                                <img src="{$user.user_photo|default='__ROOT__/Public/images/user_photo.jpg'}" width="50" height="50" align="center" title="{$user.user_name}" id="{$user.id}" >
                                <span>{$user.user_name}</span>
                            </div>
                        </volist>


                    </div>
                    <div id="flowI" class="flowhead">
                        <volist name ="flow_user_info" id="user">
                            <div class="headimg">
                                <img src="{$user.user_photo|default='__ROOT__/Public/images/user_photo.jpg'}" width="50" height="50" align="center"  title="{$user.user_name}" id="{$user.id}" >
                                <span>{$user.user_name}</span>
                                <p><span onclick="addFlow('{$user.id}');">关注TA</span></p>
                            </div>
                        </volist>
                    </div>
                </div>
            </div>
        </div>
	<include file="Index:bottom" />
    <!--页尾部分-->	
	</div>
    </body>
</html>
<script>
    $(function(){
        bindPage();
        bindtab();
        bindcaina();
        bindhulue();
        //viewall();
        bindiflowimg();
        bindflowiimg();
        bindshowall();
    });
    function addFlow(id){
        
        var url="__APP__/Home/User/addFlow"
        $.get(url,
        {
            id:id
        },
        function(data){
            if(data == 1){
                var num = $("#flowed").text();
                num = parseInt(num) +1;
                $("#flowed").text(num);
                alert('关注成功');
            }
            else if(data == 2){
                alert('请不要关注自己');
            }
            else if(data == 3){
                alert('已关注');
            }
            else{
                alert('关注失败');
            }
        }
    );
    }

    function bindiflowimg(){
        $("#Iflow img").click(function(){
            var img = $(this);
            var title = img.attr("title");
            $("#showtitle").html(title);
            var id = img.attr("id");
           
            var url="__APP__/Home/User/myFlowByid"
            $.post(url,
            {
                id:id
            },
            function(data){
                if(data == 2){
                    alert('你还没有关注该会员');
                }else{
                    
                    $("#sharemessageList").html(data);
                }
               
            }
        );
        })
    }

    function bindflowiimg(){
        $("#flowI img").click(function(){
            var img = $(this);
            var title = img.attr("title");
            $("#showtitle").html(title);
            var id = img.attr("id");

            var url="__APP__/Home/User/flowMyByid"
            $.post(url,
            {
                id:id
            },
            function(data){
                if(data == 2){
                    alert('该会员还没有关注您');
                }else{

                    $("#sharemessageList").html(data);
                }

            }
        );
        })
    }

    function show_my_flow(condition){
        var url="__APP__/Home/User/myFlowByid";
        var id = $("#userid").val();
        $.post(
            url,
            {p:condition,id:id},
            function(data){
                $("#sharemessageList").html(data);
            }
        )
    }
    function show_flow_my(condition){
        var url="__APP__/Home/User/flowMyByid";
        var id = $("#userid").val();
        $.post(
            url,
            {p:condition,id:id},
            function(data){
                $("#sharemessageList").html(data);
            }
        )
    }

</script>

